Method, apparatus and computer program product for detecting and powering off unused I/O slots in a computer system

ABSTRACT

A method, apparatus and computer program product are provided for detecting and powering off unused I/O slots in a computer system. For each of the I/O slots, the current slot is checked to determine if the slot is powered on and unlocked. When the current slot is powered on and unlocked, the current slot is checked to determine if the current slot is a candidate for being powered off. When the current slot is determined to be a candidate for being powered off, then the current slot is powered off and the checking continues with a next one of the I/O slots. Recording the slot as a candidate for being powered off before the slot is actually powered off ensures a proper delay to avoid powering off a slot that is about to be locked, which could cause slot power cycles in quick succession.

FIELD OF THE INVENTION

[0001] The present invention relates generally to the data processingfield, and more particularly, relates to a method, apparatus andcomputer program product for detecting and powering off unusedinput/output (I/O) slots in a computer system including a logicallypartitioned computer system.

DESCRIPTION OF THE RELATED ART

[0002] Low power consumption by computer systems and components is aselling point for computers because it saves customers money throughlower utility bills and less machine room cooling equipment.

[0003] On some known logically partitioned computer systems, I/O slotswith adapters in them or occupied I/O slots are powered on automaticallyby the hardware when the enclosure, or power domain, in which the slotsreside goes through a Power-On-Reset (POR), that is when the enclosureor power domain powers on.

[0004] Some known computer systems that support logical partitioning donot attempt to power off unused I/O slots. Rather, occupied I/O slotsremain powered on as long as the platform is powered on, regardless ofwhether the I/O slots are being used or not. Powering these I/O slotstakes more power and costs the customer more money.

[0005] On a logically partitioned system there are well defined andplatform controlled situations where I/O adapters are not being used forextended periods of time. One example is when an I/O slot is notassigned to a logical partition. Another example is when the logicalpartition to which an I/O slot is assigned is powered off.

[0006] A need exists for a mechanism for detecting and powering offunused I/O slots in a logically partitioned computer system.

SUMMARY OF THE INVENTION

[0007] A principal object of the present invention is to provide amethod, apparatus and computer program product for detecting andpowering off unused I/O slots in a computer system. Another importantobject of the present invention is to provide such method, apparatus andcomputer program product for detecting and powering off unused I/O slotssubstantially without negative effect and that overcomes some of thedisadvantages of prior art arrangements.

[0008] In brief, a method, apparatus and computer program product areprovided for detecting and powering off unused I/O slots in a computersystem including a logically partitioned computer system. For each ofthe I/O slots, the current slot is checked to determine if the slot ispowered on. Responsive to the current slot being powered on, the currentslot is checked to determine if the slot is unlocked. Responsive to thecurrent slot being unlocked, the current slot is checked to determine ifthe current slot is a candidate for being powered off. Responsive to thecurrent slot being unlocked and being a candidate for being powered off,the current slot is powered off and checking continues with a next oneof the I/O slots.

[0009] In accordance with features of the invention, when the currentslot is unlocked and is not already a candidate for being powered off,then the current slot is recorded as being a candidate for being poweredoff. Then checking continues with a next one of the I/O slots. Recordingthe slot as a candidate for being powered off and then repeating aniteration of checking the I/O slots before the candidate slot is poweredoff ensures a proper delay occurs before the slot is actually poweredoff and avoids powering off a slot that is about to be locked, whichcould cause slot power cycles in quick succession.

BRIEF DESCRIPTION OF THE DRAWINGS

[0010] The present invention together with the above and other objectsand advantages may best be understood from the following detaileddescription of the preferred embodiments of the invention illustrated inthe drawings, wherein:

[0011]FIG. 1 is a block diagram illustrating a logically partitionedcomputer system for implementing methods for detecting and powering offunused I/O slots in accordance with the preferred embodiment;

[0012]FIGS. 2 and 3 are block diagrams respectively illustrating oneexemplary hardware implementation and one exemplary logicallypartitioned software implementation that may be used in the computersystem of FIG. 1 in accordance with the preferred embodiment; and

[0013]FIG. 4 is a flow chart illustrating exemplary steps performed bythe logically partitioned computer system of FIG. 1 for implementingmethods for detecting and powering off unused I/O slots in accordancewith the preferred embodiment; and

[0014]FIG. 5 is a block diagram illustrating a computer program productin accordance with the preferred embodiment.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT

[0015] In accordance with features of the preferred embodiment, unusedI/O slots are powered off automatically. A method is provided tocontinuously monitor for and detect I/O slots that are not needed on alogically partitioned computer system so that unneeded I/O slots can bepowered off. First an unused slot is recorded as a candidate for beingpowered off, then a delay occurs before the candidate slot is actuallypowered off to avoid otherwise possible slot power cycles in quicksuccession.

[0016] Referring now to the drawings, in FIG. 1 there is shown alogically partitioned computer system generally designated by thereference character 100 for implementing methods for detecting andpowering off unused I/O slots in accordance with the preferredembodiment. Computer system 100 includes a plurality of main processors1-N, 102 coupled by a system bus 103 to a system memory 104 including aresource and partition manager 106, an I/O slot lock mechanism 108, I/Oslot locks 110, a power on/power off slot mechanism 112, and partitions1 -N, 114 together with respective operating systems 1 -N, 116. Aplurality of I/O slots 118 is connected to the system bus 103. A massstorage interface 120 coupled to the system bus 103 connects a directaccess storage device (DASD) 122 and a CD-ROM drive 124 to the mainprocessor 102 and the system memory 104. A separate recording media 125,such as a floppy disk, a high capacity read only memory in the form ofan optically read compact disk or CD-ROM is shown that contains, forexample, a computer program product for carrying out methods of thepreferred embodiment. Computer system 100 includes a display interface126 connected to a display 128, and a network interface 130 coupled tothe system bus 103. A local area network (LAN) or wide area network(WAN) 132 connected to the network interface 130 couples I/O devices140, such as a personal computer to the computer system 100.

[0017] Computer system 100 is shown in simplified form sufficient for anunderstanding of the invention. Computer system 100 can be implementedwith various computers, for example, with one of the IBM eServer line ofcomputers manufactured by International Business Machines Corporation.It should be understood that the present invention applies to anycomputer system that includes one or more I/O slots, where I/O adaptersare not being used for extended periods of time and the I/O slotsadvantageously are powered off in accordance with features of thepreferred embodiment.

[0018] Referring now to FIG. 2, there is shown an exemplary hardwarearrangement generally designated by 200 of the computer system 100including, for example, a first enclosure 202 containing the processors1-N, 102 and memory 104 coupled together by the system bus 103. A secondenclosure 204 contains I/O components coupled to a bus 206 that iscoupled to the system bus 103 via a bus interface 208 within the firstenclosure 202. As shown, a pair of PCI host bridges 210A, 210B coupledto bus 206 respectively connect the processors 1-N, 102 and memory 104to a pair of primary peripheral component interconnect (PCI) buses 212A,212B. Each of the PCI host bridges 210A, 210B provides an interface tofour PCI to PCI bridges, 1-4, 214A-214D, and 5-8, 214E-214H connectedvia the primary PCI buses 212A, 212B. A respective one of the PCI to PCIbridges 1-8, 214A-214H is connected to a PCI slot 1-8, 118A-118H via arespective secondary PCI bus 218A-218H.

[0019] Referring now to FIG. 3, there is shown an exemplary softwarearrangement of the computer system 100 including a hypervisor 300 forimplementing methods for detecting and powering off unused I/O slots inaccordance with the preferred embodiment. The hypervisor 300 controlsthe run-time partitioned environment and implements functions ofresource and partition manager 106 of FIG. 1. As shown in FIG. 3,hypervisor 300 includes an operating system kernel 304.

[0020] Hypervisor 300 includes a hypervisor hardware manager 308 thatencapsulates hypervisor functions to access and control hardware statesof the PCI adapter slots 1-8, 118A-118H including power on/power offslot mechanism 112. The I/O slot lock mechanism 108 encapsulate thefunctions to set the ownership of the slot lock 110 and to serializetransfer of a slot lock between hypervisor 300 and logical partitions114A-114N. Logical partitions 114A-114N communicate with the hypervisor300 to invoke hypervisor functions. Hypervisor 300 is an agent of asystem administrator interface 310, and performs partition configurationand platform service operations requested by the system administrator312 through interface 310. System administrator 312 includes anadministration console 314 and a hardware console 316.

[0021] Hypervisor operating system kernel 304 includes a task forimplementing methods for detecting and powering off unused I/O slots inaccordance with the preferred embodiment as illustrated and described inFIG. 4.

[0022] It should be understood that the present invention is not limitedfor use with the illustrated computer system 100, hardware arrangement200 or hypervisor 300. The illustrated computer system 100, hardwarearrangement 200 and hypervisor 300 are not intended to implyarchitectural or operating system limitations. The present invention canbe used with various computer systems having a plurality of I/O slotsand various other internal hardware or peripheral devices. For example,computer system 100 may contain multiple buses, rather than the singlesystem bus 103 shown in FIG. 1, and other bus architectures than theillustrated PCI bus architecture of FIG. 2 may be used. While eight PCII/O slots 1-8, 118A-118H are shown in FIG. 2, it should be understoodthat the present invention is not limited to use with PCI I/O slots or aparticular number of I/O slots.

[0023] In accordance with features of the preferred embodiment, themethod involves continuously iterating through all I/O slots 118 in thesystem 100 looking for slots that are powered on but not being used. Forexample, determining whether a slot is being used or not is done basedon the status of the slot lock associated with the slot. If the slotlock for a slot is not held, the slot is considered unused. There areperiods of time when I/O adapters or slots 118 in the logicallypartitioned system 100 are not being used and are powered off by themethod of the preferred embodiment. Then when I/O slots 118 are neededthe slots are powered on again.

[0024] In accordance with features of the preferred embodiment, toensure unused slots 118 are powered off, a hypervisor task in hypervisoroperating system kernel 304 is started at platform initial program load(IPL) and runs continuously while the hypervisor 300 is active; that is,the hypervisor task exists until the hypervisor 300 is terminatedtypically at platform power off or reboot.

[0025] For example, consider the logically partitioned system 200 witheight I/O slots, 1-8, 118A-118H, that are occupied and may be containedin a single I/O expansion unit or enclosure 204. I/O slots 1-4,118A-118D are assigned to partition 1, 114, which is powered on. I/Oslots 5-7 118E-118G are assigned to partition 2, 114, which is poweredoff. I/O slot 8, 118H is not assigned to a partition. At some pointwhile the platform is up and running, the enclosure 204 in which I/Oslots 1-8 118A-118H reside goes through a power-on-reset (POR). The PORcould be the result of one of multiple events. Temporary loss andrestoration of A/C power would cause a POR, as would happen if the powercord accidentally got pulled out and re-inserted, or electricitytemporarily is interrupted and restored. A concurrent maintenanceprocedure on the enclosure 204 would also cause a POR, such as aconcurrent repair action where the hardware management console is usedto power off the enclosure, a part is replaced, and the hardwaremanagement console is used to power on the enclosure again. When theenclosure 204 goes through the POR, all contained I/O slots 1-8,118A-118H are powered on automatically by the hardware.

[0026] Hypervisor task of hypervisor operating system kernel 304 of thepreferred embodiment that started at hypervisor IPL and runscontinuously while the hypervisor 300 is powered on, is continuouslylooking for any of the I/O slots 1-8, 118A-118H that are not needed andcan be powered off, such as slots 5-8 118E-118H in the above example.The task uses a hypervisor interface, such as power on/power off slotmechanism 112 to determine whether a slot is powered on and to power offan unused slot. The task determines whether a slot is needed based onwhether the slot lock 110 for a slot is held or not. The slot lock 110is a mechanism used to ensure an entity accessing a particular one ofslots 1-8, 118A-118H is authorized to do so, as well as to serve as asynchronization point for resetting the slot and disabling memory andother mappings associated with the slot during a dynamic transfer of theslot between partitions 1-N, 114A-114N. In other words, before anentity, such as a partition 1-N, 114A-114N or an external service agentsuch as hardware management console 316, is allowed to access aparticular I/O slot 1-8, 118A-118H through hypervisor controlsassociated with the slot, the entity must hold the slot look 110 for theslot. If the slot lock 110 associated with a slot 1-8, 118A-118H is notheld or the slot is not locked, the slot is not being used. Thus, thehypervisor task of the preferred embodiment considers an I/O slot 1-8,118A-118H that is powered on, but for which the lock is not held, acandidate for power off.

[0027] In accordance with features of the preferred embodiment, toprevent repeated power cycles of I/O slots in quick succession duringenclosure concurrent maintenance procedures and procedures involving thedynamic transfer of a slot between partitions (LPAR), which can bedetrimental to some I/O adapters, the hypervisor task of the preferredembodiment does not immediately power off a slot upon detecting the slotlock not held. Rather, the hypervisor task records the fact that theslot was found to be a candidate for power off and continues iteratingthrough slots in the system. When the hypervisor task of the preferredembodiment has finished iteration through all I/O slots 1-8, 118A-118Hin the system 100, recording those that are candidates for power off, itdelays for a short time after which it begins another iteration throughthe slots. Each slot that is found to be a candidate for power off, thatwas also recorded as a candidate the previous iteration through theslots, is powered off and the candidate status cleared. When a slot isencountered that was recorded as a candidate for power off during theprevious iteration through the slots, the candidate status is clearedregardless of whether the slot is still a candidate or not, so that thenext time the slot is found to be a candidate for power off the slotdoes not appear as though the slot was found to be a candidate duringthe previous iteration. This ensures the proper delay occurs before theslot is actually powered off so as to not power off a slot that is aboutto be locked, which could cause slot power cycles in quick succession.

[0028] Referring now to FIG. 4, there are shown exemplary stepsperformed by the hypervisor task for implementing methods for detectingand powering off unused I/O slots 118 in the logically partitionedcomputer system 100 in accordance with the preferred embodiment startingat a block 400. As indicated in a block 402, for each slot 118 in thesystem 100, checking is performed to determine if the current slot ispowered on as indicated in a decision block 404. When the current slotis powered on, checking is performed to determine if the slot isunlocked as indicated in a decision block 406. If the current slot isnot powered on or if the slot is locked, then checking is performed todetermine if the slot is on the candidate list as indicated in adecision block 408. If the slot is on the candidate list, the slot isremoved from the candidate list as indicated in a block 410. Ifdetermined at decision block 406 that the slot is unlocked, thenchecking is performed to determine if the slot is on the candidate listas indicated in a decision block 412. If the slot is not on thecandidate list, the slot is added to the candidate list as indicated ina block 414. If the slot is on the candidate list, the slot is removedfrom the candidate list as indicated in a block 416. Then the slot islocked to gain access to the slot and the slot is powered off asindicated in a block 418. Checking whether the current slot is the lastslot is performed as indicated in a decision block 420. When the currentslot is not the last slot, then the next slot is accessed as indicatedin a block 422. When the current slot is the last slot, then a delay,for example a delay of 3-5 minutes, is provided as indicated in a block424. Then the sequential steps return to block 402 and are repeatediterating thought each slot 118 in the system 100.

[0029] It should be understood that variations of the exemplary steps ofFIG. 4 are within the scope of the present invention. For example, onevariation of the illustrated exemplary steps would be to insert a properdelay immediately upon detecting a slot that is a candidate for poweroff, rather than recording the fact that the slot was a candidate andnot powering off the slot until it is determined to still be a candidateduring the next iteration through the slots. The illustratedimplementation of FIG. 4 is considered preferable because it appearsmore orderly to an observer and executes the delays in parallelresulting in unused slots being powered off sooner when a set of relatedslots become candidates for power off as a group, such as might occurwhen an enclosure, such as enclosure 204 is powered off and then backon. Another variation would be to omit the delay altogether and allowthe possibility that slots are power cycled in quick succession, and theresulting detrimental effects to the adapters contained therein.

[0030] Referring now to FIG. 5, an article of manufacture or a computerprogram product 500 of the invention is illustrated. The computerprogram product 500 includes a recording medium 502, such as, a floppydisk, a high capacity read only memory in the form of an optically readcompact disk or CD-ROM, a tape, a transmission type media such as adigital or analog communications link, or a similar computer programproduct. Recording medium 502 stores program means 504, 506, 508, 510 onthe medium 502 for carrying out the methods for detecting and poweringoff unused I/O slots of the preferred embodiment in the system 100 ofFIG. 1.

[0031] A sequence of program instructions or a logical assembly of oneor more interrelated modules defined by the recorded program means 504,506, 508, 510, direct the computer system 100 for detecting and poweringoff unused I/O slots of the preferred embodiment.

[0032] While the present invention has been described with reference tothe details of the embodiments of the invention shown in the drawing,these details are not intended to limit the scope of the invention asclaimed in the appended claims.

What is claimed is:
 1. A method for detecting and powering off unusedinput/output (I/O) slots in a computer system including a logicallypartitioned computer system comprising the steps of: for each of the I/Oslots, checking if the current slot is powered on; responsive to thecurrent slot being powered on, checking if the current slot is unlocked;responsive to the current slot being unlocked, checking if the currentslot is a candidate for being powered off, responsive to the currentslot being unlocked and being said candidate for being powered off,powering off the current slot; and continuing with a next one of the I/Oslots as the current slot.
 2. A method for detecting and powering offunused I/O slots as recited in claim 1 wherein the step of powering offthe current slot includes removing the current slot from being saidcandidate for being powered off.
 3. A method for detecting and poweringoff unused I/O slots as recited in claim 1 includes the steps responsiveto the current slot not being powered on, of checking if the currentslot is a candidate for being powered off.
 4. A method for detecting andpowering off unused I/O slots as recited in claim 3 includes the stepsresponsive to the current slot not being said candidate for beingpowered off, checking if the current slot is the last slot; andresponsive to the current slot not being the last slot of continuingwith a next slot.
 5. A method for detecting and powering off unused I/Oslots as recited in claim 3 includes the steps responsive to the currentslot being said candidate for being powered off, of removing the currentslot from being said candidate for being powered off; checking if thecurrent slot is the last slot; and responsive to the current slot notbeing the last slot of going to a next slot.
 6. A method for detectingand powering off unused I/O slots as recited in claim 1 includes thesteps responsive to the current slot being locked, of checking if thecurrent slot is a candidate for being powered off.
 7. A method fordetecting and powering off unused I/O slots as recited in claim 6includes the steps responsive to the current slot being said candidatefor being powered off, of removing the current slot from being saidcandidate for being powered off; checking if the current slot is thelast slot; and responsive to the current slot not being the last slot ofgoing to a next slot.
 8. A method for detecting and powering off unusedI/O slots as recited in claim 1 includes the steps responsive to thecurrent slot being powered on and unlocked and not being said candidatefor being powered off, of adding the current slot as said candidate forbeing powered off; checking if the current slot is the last slot; andresponsive to the current slot not being the last slot of going to anext slot.
 9. A method for detecting and powering off unused I/O slotsas recited in claim 1 includes the steps of identifying the current slotas being a last one of the I/O slots, providing a delay, and thensequentially repeating the checking steps for each of the I/O slots. 10.A computer program product for implementing detecting and powering offunused input/output (I/O) slots in a computer system including alogically partitioned computer system, said computer program productincluding instructions executed by the computer system to cause thecomputer system to perform the steps of: for each of the I/O slots,checking if the current slot is powered on; responsive to the currentslot being powered on, checking if the current slot is unlocked;responsive to the current slot being unlocked, checking if the currentslot is a candidate for being powered off, responsive to the currentslot being unlocked and not being said candidate for being powered off,recording the current slot as a candidate for being powered off;responsive to the current slot being unlocked and being said candidatefor being powered off, powering off the current slot; and continuingwith a next one of the I/O slots as the current slot.
 11. A computerprogram product for implementing detecting and powering off unused I/Oslots as recited in claim 10 wherein said instructions further cause thecomputer system to perform the steps responsive to the current slot notbeing powered on, of checking if the current slot is a candidate forbeing powered off; and responsive to the current slot being saidcandidate for being powered off, removing the current slot from beingsaid candidate for being powered off.
 12. A computer program product forimplementing detecting and powering off unused I/O slots as recited inclaim 10 wherein said instructions further cause the computer system toperform the steps responsive to the current slot being locked, checkingif the current slot is a candidate for being powered off, and responsiveto the current slot being said candidate for being powered off, removingthe current slot from being said candidate for being powered off.
 13. Acomputer program product for implementing detecting and powering offunused I/O slots as recited in claim 10 wherein said instructionsfurther cause the computer system to perform the steps of identifyingthe current slot as being a last one of the I/O slots, providing adelay, and then sequentially repeating the checking steps for each ofthe I/O slots.
 14. A computer program product for implementing detectingand powering off unused input/output (I/O) slots as recited in claim 10wherein step of powering off the current slot includes removing thecurrent slot from being said candidate for being powered off. 15.Apparatus for detecting and powering off unused input/output (I/O) slotsin a computer system including a logically partitioned computer systemcomprising: a plurality of I/O slots; a slot lock mechanism forauthorizing defined entities exclusive access to one or more of the I/Oslots and locking said one or more of the I/O slots and for unlocking anunused I/O slot; a power on and power off slot mechanism for powering onthe I/O slots and for selectively powering off one or more of the I/Oslots; an operating system kernel task performing, for each of the I/Oslots, the steps of, checking if the current slot is powered on;responsive to the current slot being powered on, checking if the currentslot is unlocked; responsive to the current slot being unlocked,checking if the current slot is a candidate for being powered off,responsive to the current slot being unlocked and not being saidcandidate for being powered off, recording the current slot as acandidate for being powered off; responsive to the current slot beingunlocked and being said candidate for being powered off, powering offthe current slot; and continuing with a next one of the I/O slots as thecurrent slot.
 16. Apparatus for detecting and powering off unused I/Oslots as recited in claim 15 wherein said operating system kernel taskfurther performs the steps of identifying the current slot as being alast one of the I/O slots, providing a set delay, and then sequentiallyrepeating the checking steps for each of the I/O slots.
 17. Apparatusfor detecting and powering off unused I/O slots as recited in claim 15wherein said operating system kernel task further performs the stepsresponsive to the current slot not being powered on, of checking if thecurrent slot is a candidate for being powered off; and responsive to thecurrent slot being said candidate for being powered off, removing thecurrent slot from being said candidate for being powered off. 18.Apparatus for detecting and powering off unused I/O slots as recited inclaim 15 wherein said operating system kernel task further performs thesteps responsive to the current slot being locked, of checking if thecurrent slot is a candidate for being powered off, and responsive to thecurrent slot being said candidate for being powered off, removing thecurrent slot from being said candidate for being powered off.